﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.ComponentModel.DataAnnotations;
using System.Web.Mvc;

namespace vwsol_DuHoc.Areas.Administrator.Models
{
    [MetadataType(typeof(TeacherMetadata))]
    public partial class Teacher
    {
        public void Default()
        {
            if (this.TeacherContent == null)
            {
                this.TeacherContent = "";
            }
            if (this.Image == null)
            {
                this.Image = "~/Resource/img/noimg.gif";
            }
            this.IsDelete = false;
            this.CreateDate = DateTime.Now;
        }
    }

    public class TeacherMetadata
    {
        [Required]
        public string TeacherName { get; set; }
        [Required]
        public string TeacherDescription { get; set; }
        [AllowHtml]
        public string TeacherContent { get; set; }
    }
}